package com.emily.test.service.impl;

import com.emily.test.mapper.RCompanyRoleMapper;
import com.emily.test.model.RCompanyRole;
import com.emily.test.service.RCompanyRoleService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@Service(value = "RCompanyRoleServiceAgent")
@Transactional(propagation = Propagation.REQUIRED,isolation = Isolation.DEFAULT,timeout=36000,rollbackFor=Exception.class)
public class RCompanyRoleServiceImpl implements RCompanyRoleService {

    @Resource
    private RCompanyRoleMapper rCompanyRoleMapper;

    @Override
    public List<RCompanyRole> selectRoleIdListByCompanyId(int companyId) {
        return rCompanyRoleMapper.selectRoleIdListByCompanyId(companyId);
    }

    @Override
    public int insert(RCompanyRole rCompanyRole) {
        return rCompanyRoleMapper.insert(rCompanyRole);
    }

    @Override
    public int insertTRoleResourceInfo(Map<String, Object> map) {
        return rCompanyRoleMapper.insertTRoleResourceInfo(map);
    }


    @Override
    public int deleteRCompanyRoleByCompanyId(int companyId) {
        return rCompanyRoleMapper.deleteRCompanyRoleByCompanyId(companyId);
    }
}
